package zdream.utils;

import java.util.Arrays;
import java.util.Collection;
import java.util.stream.Collectors;

/**
 * @author Zdream
 * @date 2023-11-21
 * @since 0.0.1
 */
public class StringUtils {
	public static String join(CharSequence delimiter, Collection<?> objects) {
		return objects.stream().map(Object::toString).collect(Collectors.joining(delimiter));
	}

	public static String join(CharSequence delimiter, Object[] objects) {
		return Arrays.stream(objects).map(Object::toString).collect(Collectors.joining(delimiter));
	}

	public static String join(CharSequence delimiter, int[] objects) {
		return Arrays.stream(objects).mapToObj(Integer::toString).collect(Collectors.joining(delimiter));
	}
}
